#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
using namespace std;

#define MAX_SIZE 100
typedef struct crocodile *Ptrtocro;
typedef struct crocodile
{
    int x;
    int y;
    double d;
    bool v;
    int pre_id;
    int my_id;
}croco[MAX_SIZE];

// function
bool FirstJump(int x, int y, int D);
bool Jump(int now_x, int now_y, int next_x, int next_y, int D);
bool IsSafe(int x, int y, int D);
bool cmp(crocodile a, crocodile b);

int main()
{
    int N, D, x_, y_, step = 0, temp_id;
    croco Allcroco;
    // 为了更好使用sort直接排序，使用vector
    vector<crocodile> myqueue;
    stack<int> mystack;
    crocodile now;
    bool Safe = false;
    scanf("%d %d", &N, &D);

    // 一步就能跳到岸上 不需要经过鳄鱼
    if (D >= 25)
        printf("1\n");
    else
    {
        for (int i = 0; i < N; i++)
        {
            scanf("%d %d", &x_, &y_);
            // init
            Allcroco[i].d = x_ * x_ + y_ * y_;
            Allcroco[i].x = x_;
            Allcroco[i].y = y_;
            Allcroco[i].pre_id = -1;
            Allcroco[i].my_id = i;
            Allcroco[i].v = false;
            // init

            // 岛内和边界的都直接以访问过再后续被去掉
            if (Allcroco[i].d <= 7.5 * 7.5 || abs(x_) >= 50 || abs(y_) >= 50)
                Allcroco[i].v = true;
            else if (FirstJump(x_, y_, D))
            {
                Allcroco[i].pre_id = 0;
                myqueue.push_back(Allcroco[i]);
                Allcroco[i].v = true;
            }
        }
        // 如果没有第一步的落脚点 直接失败
        if(myqueue.empty())
            printf("0\n");
        else
        {
            sort(myqueue.begin(), myqueue.end(), cmp);
            /* ---------------------------- BFS ------------------------ */
            while(!myqueue.empty())
            {
                now = myqueue.front();
                myqueue.erase(myqueue.begin());
                if(IsSafe(now.x, now.y, D))
                {
                    Safe = true;
                    break;
                }
                // 判断是否相邻并可跳
                for (int i = 0; i < N; i++)
                {
                    crocodile next = Allcroco[i];
                    if(!next.v && Jump(now.x, now.y, next.x, next.y, D))
                    {
                        myqueue.push_back(next);
                        Allcroco[i].v = true;
                        Allcroco[i].pre_id = now.my_id;
                    }
                }
            }
            if(Safe)
            {
                mystack.push(now.my_id);
                step = 1;
                while(true)
                {
                    temp_id = Allcroco[now.my_id].pre_id;
                    step++;
                    if(temp_id == 0)
                        break;
                    mystack.push(temp_id);
                    now = Allcroco[temp_id];
                }
                printf("%d\n", step);
                while(!mystack.empty())
                {
                    temp_id = mystack.top();
                    now = Allcroco[temp_id];
                    printf("%d %d\n", now.x, now.y);
                    mystack.pop();
                }
            }
            else
                printf("0");
        }
    }

    return 0;
}
bool FirstJump(int x, int y, int D)
{
    if ((x * x + y * y) <= (7.5 + D) * (7.5 + D))
        return true;
    else
        return false;
}
bool Jump(int now_x, int now_y, int next_x, int next_y, int D)
{
    if ((now_x - next_x) * (now_x - next_x) + (now_y - next_y) * (now_y - next_y) <= D * D)
        return true;
    else
        return false;
}
bool IsSafe(int x, int y, int D)
{
    if (abs(x) + D >= 50 || abs(y) + D >= 50)
        return true;
    else
        return false;
}
bool cmp(crocodile a, crocodile b)
{
    return a.d < b.d;
}